package com.views
{
	import com.Controller;
	import com.Data;
	import com.SuperBase;
	import com.SuperSubBase;
	import com.View;
	import com.assist.data.IData;
	import com.views.structure.Popup;
	
	public class Base extends SuperSubBase
	{
		protected var _view :View;
		protected var _instanceName :String;
		protected var _ctrl :Controller;
		protected var _data :IData;
		protected var _structure :Structure;
		protected var _popup :Popup;
		protected var _inStageTipTitle:String;
		protected var _inStageTipContent:String;
		protected var _ignoreKeyboardEvent:Boolean = false;
		
		public function Base()
		{
			super();
		}
		
		public function get inStage() : Boolean {
			return _popup.hasView( this as IView );
		}
		
		public function get inStageWithTip() : Boolean {
			if( inStage && _inStageTipTitle ) {
				
			}
			
			return inStage;
		}
		
		public function get ignoreKeyboardEvent() : Boolean
		{
			return _ignoreKeyboardEvent;
		}
		
		override public function settle(className :String, view :View, ctrl :Controller, data :Data, superBase :SuperBase) : void
		{
			if (_view == null)
			{
				_instanceName = className;
				_view = view;
				if (_view != superBase)
				{
					throw new Error(inheritError());
				}
				_ctrl = ctrl;
				_data = data as IData;
				if (_ctrl.hasOwnProperty(className) && hasOwnProperty("ownCtrl"))
				{
					this["ownCtrl"] = _ctrl[className];
				}
			}
			_structure = _view.structure;
			_popup = _view.structure.popup;
		}
	}
}